package com.breakfast.fun.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.breakfast.fun.dao.Address;
import com.breakfast.fun.dao.GoodCart;
import com.breakfast.fun.dao.ProductCart;

import com.breakfast.fun.dao.AddressDao;
import com.breakfast.fun.dao.GoodCartDao;
import com.breakfast.fun.dao.ProductCartDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig addressDaoConfig;
    private final DaoConfig goodCartDaoConfig;
    private final DaoConfig productCartDaoConfig;

    private final AddressDao addressDao;
    private final GoodCartDao goodCartDao;
    private final ProductCartDao productCartDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        addressDaoConfig = daoConfigMap.get(AddressDao.class).clone();
        addressDaoConfig.initIdentityScope(type);

        goodCartDaoConfig = daoConfigMap.get(GoodCartDao.class).clone();
        goodCartDaoConfig.initIdentityScope(type);

        productCartDaoConfig = daoConfigMap.get(ProductCartDao.class).clone();
        productCartDaoConfig.initIdentityScope(type);

        addressDao = new AddressDao(addressDaoConfig, this);
        goodCartDao = new GoodCartDao(goodCartDaoConfig, this);
        productCartDao = new ProductCartDao(productCartDaoConfig, this);

        registerDao(Address.class, addressDao);
        registerDao(GoodCart.class, goodCartDao);
        registerDao(ProductCart.class, productCartDao);
    }
    
    public void clear() {
        addressDaoConfig.clearIdentityScope();
        goodCartDaoConfig.clearIdentityScope();
        productCartDaoConfig.clearIdentityScope();
    }

    public AddressDao getAddressDao() {
        return addressDao;
    }

    public GoodCartDao getGoodCartDao() {
        return goodCartDao;
    }

    public ProductCartDao getProductCartDao() {
        return productCartDao;
    }

}
